package cn.swu.todolist

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.Button
import android.widget.EditText
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import java.util.stream.DoubleStream.builder

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val username=findViewById<EditText>(R.id.username)
        val password=findViewById<EditText>(R.id.password)
        findViewById<Button>(R.id.loginbtn).setOnClickListener()
        {
            mainclick()
        }
    }

    private fun mainclick() {
        AlertDialog.Builder(this)
            .setNegativeButton("取消"){d,w-> Toast.makeText(this,"已退出", Toast.LENGTH_SHORT).show()}
            .setPositiveButton("确定"){d,w->jump1()}
            .setMessage("请确认是否登录？")
            .setTitle("提示！")
            .show()
    }
    fun jump1()
    {
        println("@@here00!!!")
        intent= Intent(this,todolist::class.java)
        startActivity(intent)
    }

}